define(['jquery', 'ext'], function($, T) {
  $(function() {

    $('head').append('<style>'
      + '.footer-refresh { width: 10px; height: 60px; white-space: nowrap; overflow: hidden; padding: 10px 0 10px 10px; transition: width 0.2s; -moz-transition: width 0.2s; -webkit-transition: width 0.2s; -o-transition: width 0.2s; position: relative; box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); background-color: #fff; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -o-box-sizing: border-box; box-sizing: border-box; }'
      + '.footer-refresh button { background-color: #eee; display: none; font-size: 20px; font-weight: lighter; width: 120px; position: absolute; right: 0; bottom: 0; border: 0; border-radius: 0; padding: 0; margin: 0 }'
      + '.footer-refresh:hover { padding: 10px 241px 10px 10px; width: 100%; }'
      + '.footer-refresh:hover button { display: block; }'
      + '</style>');

    $('<div class="footer-refresh">')
      .append('<div id="_width">' + document.documentElement.clientWidth + ' * ' + document.documentElement.clientHeight + '</div>')
      .append('<div>' + navigator.userAgent + '</div>')
      .append($('<button class="btn btn-flush">REFRESH</button>').click(function() {
        location.href = location.protocol + '//' + location.host + location.pathname + '?' + $.param(T.extend(T.parseQueryString(location.href), {
          t: new Date().getTime()
        })) + location.hash;
      }))
      .append($('<button class="btn btn-flush" style="right:121px;">BACK</button>').click(function() {
        location.href = '../';
      }))
      .appendTo('body');
    $(window).resize(function() {
      $('#_width').text(document.documentElement.clientWidth + ' * ' + document.documentElement.clientHeight);
    })
  })
})